home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / locale.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  49KB  |  1,714 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. """ Locale support.
  5.  
  6.     The module provides low-level access to the C lib's locale APIs
  7.     and adds high level number formatting APIs as well as a locale
  8.     aliasing engine to complement these.
  9.  
  10.     The aliasing engine includes support for many commonly used locale
  11.     names and maps them to values suitable for passing to the C lib's
  12.     setlocale() function. It also includes default encodings for all
  13.     supported locale names.
  14.  
  15. """
  16. import sys
  17. import encodings
  18. import encodings.aliases as encodings
  19. import re
  20. import operator
  21. import functools
  22.  
  23. try:
  24.     _unicode = unicode
  25. except NameError:
  26.     
  27.     class _unicode(object):
  28.         pass
  29.  
  30.  
  31. __all__ = [
  32.     'getlocale',
  33.     'getdefaultlocale',
  34.     'getpreferredencoding',
  35.     'Error',
  36.     'setlocale',
  37.     'resetlocale',
  38.     'localeconv',
  39.     'strcoll',
  40.     'strxfrm',
  41.     'str',
  42.     'atof',
  43.     'atoi',
  44.     'format',
  45.     'format_string',
  46.     'currency',
  47.     'normalize',
  48.     'LC_CTYPE',
  49.     'LC_COLLATE',
  50.     'LC_TIME',
  51.     'LC_MONETARY',
  52.     'LC_NUMERIC',
  53.     'LC_ALL',
  54.     'CHAR_MAX']
  55.  
  56. try:
  57.     from _locale import *
  58. except ImportError:
  59.     CHAR_MAX = 127
  60.     LC_ALL = 6
  61.     LC_COLLATE = 3
  62.     LC_CTYPE = 0
  63.     LC_MESSAGES = 5
  64.     LC_MONETARY = 4
  65.     LC_NUMERIC = 1
  66.     LC_TIME = 2
  67.     Error = ValueError
  68.     
  69.     def localeconv():
  70.         ''' localeconv() -> dict.
  71.             Returns numeric and monetary locale-specific parameters.
  72.         '''
  73.         return {
  74.             'grouping': [
  75.                 127],
  76.             'currency_symbol': '',
  77.             'n_sign_posn': 127,
  78.             'p_cs_precedes': 127,
  79.             'n_cs_precedes': 127,
  80.             'mon_grouping': [],
  81.             'n_sep_by_space': 127,
  82.             'decimal_point': '.',
  83.             'negative_sign': '',
  84.             'positive_sign': '',
  85.             'p_sep_by_space': 127,
  86.             'int_curr_symbol': '',
  87.             'p_sign_posn': 127,
  88.             'thousands_sep': '',
  89.             'mon_thousands_sep': '',
  90.             'frac_digits': 127,
  91.             'mon_decimal_point': '',
  92.             'int_frac_digits': 127 }
  93.  
  94.     
  95.     def setlocale(category, value = None):
  96.         ''' setlocale(integer,string=None) -> string.
  97.             Activates/queries locale processing.
  98.         '''
  99.         if value not in (None, '', 'C'):
  100.             raise Error, '_locale emulation only supports "C" locale'
  101.         return 'C'
  102.  
  103.     
  104.     def strcoll(a, b):
  105.         ''' strcoll(string,string) -> int.
  106.             Compares two strings according to the locale.
  107.         '''
  108.         return cmp(a, b)
  109.  
  110.     
  111.     def strxfrm(s):
  112.         ''' strxfrm(string) -> string.
  113.             Returns a string that behaves for cmp locale-aware.
  114.         '''
  115.         return s
  116.  
  117.  
  118. _localeconv = localeconv
  119. _override_localeconv = { }
  120.  
  121. def localeconv():
  122.     d = _localeconv()
  123.     if _override_localeconv:
  124.         d.update(_override_localeconv)
  125.     return d
  126.  
  127. localeconv = functools.wraps(_localeconv)(localeconv)
  128.  
  129. def _grouping_intervals(grouping):
  130.     last_interval = None
  131.     for interval in grouping:
  132.         if interval == CHAR_MAX:
  133.             return None
  134.         if None == 0:
  135.             if last_interval is None:
  136.                 raise ValueError('invalid grouping')
  137.             while True:
  138.                 yield last_interval
  139.         yield interval
  140.         last_interval = interval
  141.     
  142.  
  143.  
  144. def _group(s, monetary = False):
  145.     conv = localeconv()
  146.     if not monetary or 'mon_thousands_sep':
  147.         pass
  148.     thousands_sep = conv['thousands_sep']
  149.     if not monetary or 'mon_grouping':
  150.         pass
  151.     grouping = conv['grouping']
  152.     if not grouping:
  153.         return (s, 0)
  154.     if None[-1] == ' ':
  155.         stripped = s.rstrip()
  156.         right_spaces = s[len(stripped):]
  157.         s = stripped
  158.     else:
  159.         right_spaces = ''
  160.     left_spaces = ''
  161.     groups = []
  162.     for interval in _grouping_intervals(grouping):
  163.         if not s or s[-1] not in '0123456789':
  164.             left_spaces = s
  165.             s = ''
  166.             break
  167.         groups.append(s[-interval:])
  168.         s = s[:-interval]
  169.     
  170.     if s:
  171.         groups.append(s)
  172.     groups.reverse()
  173.     return (left_spaces + thousands_sep.join(groups) + right_spaces, len(thousands_sep) * (len(groups) - 1))
  174.  
  175.  
  176. def _strip_padding(s, amount):
  177.     lpos = 0
  178.     while amount and s[lpos] == ' ':
  179.         lpos += 1
  180.         amount -= 1
  181.     rpos = len(s) - 1
  182.     while amount and s[rpos] == ' ':
  183.         rpos -= 1
  184.         amount -= 1
  185.     return s[lpos:rpos + 1]
  186.  
  187. _percent_re = re.compile('%(?:\\((?P<key>.*?)\\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
  188.  
  189. def format(percent, value, grouping = False, monetary = False, *additional):
  190.     """Returns the locale-aware substitution of a %? specifier
  191.     (percent).
  192.  
  193.     additional is for format strings which contain one or more
  194.     '*' modifiers."""
  195.     match = _percent_re.match(percent)
  196.     if not match or len(match.group()) != len(percent):
  197.         raise ValueError('format() must be given exactly one %%char format specifier, %s not valid' % repr(percent))
  198.     return _format(percent, value, grouping, monetary, *additional)
  199.  
  200.  
  201. def _format(percent, value, grouping = False, monetary = False, *additional):
  202.     if additional:
  203.         formatted = percent % ((value,) + additional)
  204.     else:
  205.         formatted = percent % value
  206.     if percent[-1] in 'eEfFgG':
  207.         seps = 0
  208.         parts = formatted.split('.')
  209.         decimal_point = None[localeconv() if grouping else 'decimal_point']
  210.         formatted = decimal_point.join(parts)
  211.         if seps:
  212.             formatted = _strip_padding(formatted, seps)
  213.         
  214.     elif percent[-1] in 'diu':
  215.         seps = 0
  216.         if grouping:
  217.             (formatted, seps) = _group(formatted, monetary = monetary)
  218.         if seps:
  219.             formatted = _strip_padding(formatted, seps)
  220.         
  221.     return formatted
  222.  
  223.  
  224. def format_string(f, val, grouping = False):
  225.     '''Formats a string in the same way that the % formatting would use,
  226.     but takes the current locale into account.
  227.     Grouping is applied if the third parameter is true.'''
  228.     percents = list(_percent_re.finditer(f))
  229.     new_f = _percent_re.sub('%s', f)
  230.     if operator.isMappingType(val):
  231.         new_val = []
  232.         for perc in percents:
  233.             if perc.group()[-1] == '%':
  234.                 new_val.append('%')
  235.                 continue
  236.             new_val.append(format(perc.group(), val, grouping))
  237.         
  238.     elif not isinstance(val, tuple):
  239.         val = (val,)
  240.     new_val = []
  241.     i = 0
  242.     for perc in percents:
  243.         if perc.group()[-1] == '%':
  244.             new_val.append('%')
  245.             continue
  246.         starcount = perc.group('modifiers').count('*')
  247.         new_val.append(_format(perc.group(), val[i], grouping, False, *val[i + 1:i + 1 + starcount]))
  248.         i += 1 + starcount
  249.     
  250.     val = tuple(new_val)
  251.     return new_f % val
  252.  
  253.  
  254. def currency(val, symbol = True, grouping = False, international = False):
  255.     '''Formats val according to the currency settings
  256.     in the current locale.'''
  257.     conv = localeconv()
  258.     if not international or 'int_frac_digits':
  259.         pass
  260.     digits = conv['frac_digits']
  261.     if digits == 127:
  262.         raise ValueError("Currency formatting is not possible using the 'C' locale.")
  263.     s = format('%%.%if' % digits, abs(val), grouping, monetary = True)
  264.     s = '<' + s + '>'
  265.     sign_pos = None[conv if symbol else 'p_sign_posn']
  266.     if not val < 0 or 'negative_sign':
  267.         pass
  268.     sign = conv['positive_sign']
  269.     if sign_pos == 0:
  270.         s = '(' + s + ')'
  271.     elif sign_pos == 1:
  272.         s = sign + s
  273.     elif sign_pos == 2:
  274.         s = s + sign
  275.     elif sign_pos == 3:
  276.         s = s.replace('<', sign)
  277.     elif sign_pos == 4:
  278.         s = s.replace('>', sign)
  279.     else:
  280.         s = sign + s
  281.     return s.replace('<', '').replace('>', '')
  282.  
  283.  
  284. def str(val):
  285.     '''Convert float to integer, taking the locale into account.'''
  286.     return format('%.12g', val)
  287.  
  288.  
  289. def atof(string, func = float):
  290.     '''Parses a string as a float according to the locale settings.'''
  291.     ts = localeconv()['thousands_sep']
  292.     if ts:
  293.         string = string.replace(ts, '')
  294.     dd = localeconv()['decimal_point']
  295.     if dd:
  296.         string = string.replace(dd, '.')
  297.     return func(string)
  298.  
  299.  
  300. def atoi(str):
  301.     '''Converts a string to an integer according to the locale settings.'''
  302.     return atof(str, int)
  303.  
  304.  
  305. def _test():
  306.     setlocale(LC_ALL, '')
  307.     s1 = format('%d', 123456789, 1)
  308.     print s1, 'is', atoi(s1)
  309.     s1 = str(3.14)
  310.     print s1, 'is', atof(s1)
  311.  
  312. _setlocale = setlocale
  313. _ascii_lower_map = ''.join((lambda .0: for x in .0:
  314. passx + 32(x)chrcontinue)(range(256)))
  315.  
  316. def normalize(localename):
  317.     ''' Returns a normalized locale code for the given locale
  318.         name.
  319.  
  320.         The returned locale code is formatted for use with
  321.         setlocale().
  322.  
  323.         If normalization fails, the original name is returned
  324.         unchanged.
  325.  
  326.         If the given encoding is not known, the function defaults to
  327.         the default encoding for the locale code just like setlocale()
  328.         does.
  329.  
  330.     '''
  331.     if isinstance(localename, _unicode):
  332.         localename = localename.encode('ascii')
  333.     fullname = localename.translate(_ascii_lower_map)
  334.     if ':' in fullname:
  335.         fullname = fullname.replace(':', '.')
  336.     if '.' in fullname:
  337.         (langname, encoding) = fullname.split('.')[:2]
  338.         fullname = langname + '.' + encoding
  339.     else:
  340.         langname = fullname
  341.         encoding = ''
  342.     norm_encoding = encoding.replace('-', '')
  343.     norm_encoding = norm_encoding.replace('_', '')
  344.     lookup_name = langname + '.' + encoding
  345.     code = locale_alias.get(lookup_name, None)
  346.     if code is not None:
  347.         return code
  348.     code = None.get(langname, None)
  349.     if code is not None:
  350.         if '.' in code:
  351.             (langname, defenc) = code.split('.')
  352.         else:
  353.             langname = code
  354.             defenc = ''
  355.         if encoding:
  356.             norm_encoding = encodings.normalize_encoding(encoding)
  357.             norm_encoding = encodings.aliases.aliases.get(norm_encoding, norm_encoding)
  358.             encoding = locale_encoding_alias.get(norm_encoding, norm_encoding)
  359.         else:
  360.             encoding = defenc
  361.         if encoding:
  362.             return langname + '.' + encoding
  363.         return None
  364.     return localename
  365.  
  366.  
  367. def _parse_localename(localename):
  368.     ''' Parses the locale code for localename and returns the
  369.         result as tuple (language code, encoding).
  370.  
  371.         The localename is normalized and passed through the locale
  372.         alias engine. A ValueError is raised in case the locale name
  373.         cannot be parsed.
  374.  
  375.         The language code corresponds to RFC 1766.  code and encoding
  376.         can be None in case the values cannot be determined or are
  377.         unknown to this implementation.
  378.  
  379.     '''
  380.     code = normalize(localename)
  381.     if '@' in code:
  382.         (code, modifier) = code.split('@')
  383.         if modifier == 'euro' and '.' not in code:
  384.             return (code, 'iso-8859-15')
  385.     if '.' in code:
  386.         return tuple(code.split('.')[:2])
  387.     if None == 'C':
  388.         return (None, None)
  389.     raise None, 'unknown locale: %s' % localename
  390.  
  391.  
  392. def _build_localename(localetuple):
  393.     ''' Builds a locale code from the given tuple (language code,
  394.         encoding).
  395.  
  396.         No aliasing or normalizing takes place.
  397.  
  398.     '''
  399.     (language, encoding) = localetuple
  400.     if language is None:
  401.         language = 'C'
  402.     if encoding is None:
  403.         return language
  404.     return None + '.' + encoding
  405.  
  406.  
  407. def getdefaultlocale(envvars = ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
  408.     ''' Tries to determine the default locale settings and returns
  409.         them as tuple (language code, encoding).
  410.  
  411.         According to POSIX, a program which has not called
  412.         setlocale(LC_ALL, "") runs using the portable \'C\' locale.
  413.         Calling setlocale(LC_ALL, "") lets it use the default locale as
  414.         defined by the LANG variable. Since we don\'t want to interfere
  415.         with the current locale setting we thus emulate the behavior
  416.         in the way described above.
  417.  
  418.         To maintain compatibility with other platforms, not only the
  419.         LANG variable is tested, but a list of variables given as
  420.         envvars parameter. The first found to be defined will be
  421.         used. envvars defaults to the search path used in GNU gettext;
  422.         it must always contain the variable name \'LANG\'.
  423.  
  424.         Except for the code \'C\', the language code corresponds to RFC
  425.         1766.  code and encoding can be None in case the values cannot
  426.         be determined.
  427.  
  428.     '''
  429.     
  430.     try:
  431.         import _locale as _locale
  432.         (code, encoding) = _locale._getdefaultlocale()
  433.     except (ImportError, AttributeError):
  434.         pass
  435.  
  436.     if sys.platform == 'win32' and code and code[:2] == '0x':
  437.         code = windows_locale.get(int(code, 0))
  438.     return (code, encoding)
  439.     import os as os
  440.     lookup = os.environ.get
  441.     for variable in envvars:
  442.         localename = lookup(variable, None)
  443.         if localename or variable == 'LANGUAGE':
  444.             localename = localename.split(':')[0]
  445.         break
  446.         continue
  447.     else:
  448.         localename = 'C'
  449.     return _parse_localename(localename)
  450.  
  451.  
  452. def getlocale(category = LC_CTYPE):
  453.     """ Returns the current setting for the given locale category as
  454.         tuple (language code, encoding).
  455.  
  456.         category may be one of the LC_* value except LC_ALL. It
  457.         defaults to LC_CTYPE.
  458.  
  459.         Except for the code 'C', the language code corresponds to RFC
  460.         1766.  code and encoding can be None in case the values cannot
  461.         be determined.
  462.  
  463.     """
  464.     localename = _setlocale(category)
  465.     if category == LC_ALL and ';' in localename:
  466.         raise TypeError, 'category LC_ALL is not supported'
  467.     return _parse_localename(localename)
  468.  
  469.  
  470. def setlocale(category, locale = None):
  471.     ''' Set the locale for the given category.  The locale can be
  472.         a string, an iterable of two strings (language code and encoding),
  473.         or None.
  474.  
  475.         Iterables are converted to strings using the locale aliasing
  476.         engine.  Locale strings are passed directly to the C lib.
  477.  
  478.         category may be given as one of the LC_* values.
  479.  
  480.     '''
  481.     if locale and type(locale) is not type(''):
  482.         locale = normalize(_build_localename(locale))
  483.     return _setlocale(category, locale)
  484.  
  485.  
  486. def resetlocale(category = LC_ALL):
  487.     ''' Sets the locale for category to the default setting.
  488.  
  489.         The default setting is determined by calling
  490.         getdefaultlocale(). category defaults to LC_ALL.
  491.  
  492.     '''
  493.     _setlocale(category, _build_localename(getdefaultlocale()))
  494.  
  495. if sys.platform.startswith('win'):
  496.     
  497.     def getpreferredencoding(do_setlocale = True):
  498.         '''Return the charset that the user is likely using.'''
  499.         import _locale
  500.         return _locale._getdefaultlocale()[1]
  501.  
  502. else:
  503.     
  504.     try:
  505.         CODESET
  506.     except NameError:
  507.         
  508.         def getpreferredencoding(do_setlocale = True):
  509.             '''Return the charset that the user is likely using,
  510.             by looking at environment variables.'''
  511.             return getdefaultlocale()[1]
  512.  
  513.  
  514.     
  515.     def getpreferredencoding(do_setlocale = True):
  516.         '''Return the charset that the user is likely using,
  517.             according to the system configuration.'''
  518.         if do_setlocale:
  519.             oldloc = setlocale(LC_CTYPE)
  520.             
  521.             try:
  522.                 setlocale(LC_CTYPE, '')
  523.             except Error:
  524.                 pass
  525.  
  526.             result = nl_langinfo(CODESET)
  527.             setlocale(LC_CTYPE, oldloc)
  528.             return result
  529.         return None(CODESET)
  530.  
  531. locale_encoding_alias = {
  532.     '437': 'C',
  533.     'c': 'C',
  534.     'en': 'ISO8859-1',
  535.     'jis': 'JIS7',
  536.     'jis7': 'JIS7',
  537.     'ajec': 'eucJP',
  538.     'ascii': 'ISO8859-1',
  539.     'latin_1': 'ISO8859-1',
  540.     'iso8859_1': 'ISO8859-1',
  541.     'iso8859_10': 'ISO8859-10',
  542.     'iso8859_11': 'ISO8859-11',
  543.     'iso8859_13': 'ISO8859-13',
  544.     'iso8859_14': 'ISO8859-14',
  545.     'iso8859_15': 'ISO8859-15',
  546.     'iso8859_16': 'ISO8859-16',
  547.     'iso8859_2': 'ISO8859-2',
  548.     'iso8859_3': 'ISO8859-3',
  549.     'iso8859_4': 'ISO8859-4',
  550.     'iso8859_5': 'ISO8859-5',
  551.     'iso8859_6': 'ISO8859-6',
  552.     'iso8859_7': 'ISO8859-7',
  553.     'iso8859_8': 'ISO8859-8',
  554.     'iso8859_9': 'ISO8859-9',
  555.     'iso2022_jp': 'JIS7',
  556.     'shift_jis': 'SJIS',
  557.     'tactis': 'TACTIS',
  558.     'euc_jp': 'eucJP',
  559.     'euc_kr': 'eucKR',
  560.     'utf_8': 'UTF-8',
  561.     'koi8_r': 'KOI8-R',
  562.     'koi8_u': 'KOI8-U' }
  563. locale_alias = {
  564.     'a3': 'a3_AZ.KOI8-C',
  565.     'a3_az': 'a3_AZ.KOI8-C',
  566.     'a3_az.koi8c': 'a3_AZ.KOI8-C',
  567.     'af': 'af_ZA.ISO8859-1',
  568.     'af_za': 'af_ZA.ISO8859-1',
  569.     'af_za.iso88591': 'af_ZA.ISO8859-1',
  570.     'am': 'am_ET.UTF-8',
  571.     'am_et': 'am_ET.UTF-8',
  572.     'american': 'en_US.ISO8859-1',
  573.     'american.iso88591': 'en_US.ISO8859-1',
  574.     'ar': 'ar_AA.ISO8859-6',
  575.     'ar_aa': 'ar_AA.ISO8859-6',
  576.     'ar_aa.iso88596': 'ar_AA.ISO8859-6',
  577.     'ar_ae': 'ar_AE.ISO8859-6',
  578.     'ar_ae.iso88596': 'ar_AE.ISO8859-6',
  579.     'ar_bh': 'ar_BH.ISO8859-6',
  580.     'ar_bh.iso88596': 'ar_BH.ISO8859-6',
  581.     'ar_dz': 'ar_DZ.ISO8859-6',
  582.     'ar_dz.iso88596': 'ar_DZ.ISO8859-6',
  583.     'ar_eg': 'ar_EG.ISO8859-6',
  584.     'ar_eg.iso88596': 'ar_EG.ISO8859-6',
  585.     'ar_iq': 'ar_IQ.ISO8859-6',
  586.     'ar_iq.iso88596': 'ar_IQ.ISO8859-6',
  587.     'ar_jo': 'ar_JO.ISO8859-6',
  588.     'ar_jo.iso88596': 'ar_JO.ISO8859-6',
  589.     'ar_kw': 'ar_KW.ISO8859-6',
  590.     'ar_kw.iso88596': 'ar_KW.ISO8859-6',
  591.     'ar_lb': 'ar_LB.ISO8859-6',
  592.     'ar_lb.iso88596': 'ar_LB.ISO8859-6',
  593.     'ar_ly': 'ar_LY.ISO8859-6',
  594.     'ar_ly.iso88596': 'ar_LY.ISO8859-6',
  595.     'ar_ma': 'ar_MA.ISO8859-6',
  596.     'ar_ma.iso88596': 'ar_MA.ISO8859-6',
  597.     'ar_om': 'ar_OM.ISO8859-6',
  598.     'ar_om.iso88596': 'ar_OM.ISO8859-6',
  599.     'ar_qa': 'ar_QA.ISO8859-6',
  600.     'ar_qa.iso88596': 'ar_QA.ISO8859-6',
  601.     'ar_sa': 'ar_SA.ISO8859-6',
  602.     'ar_sa.iso88596': 'ar_SA.ISO8859-6',
  603.     'ar_sd': 'ar_SD.ISO8859-6',
  604.     'ar_sd.iso88596': 'ar_SD.ISO8859-6',
  605.     'ar_sy': 'ar_SY.ISO8859-6',
  606.     'ar_sy.iso88596': 'ar_SY.ISO8859-6',
  607.     'ar_tn': 'ar_TN.ISO8859-6',
  608.     'ar_tn.iso88596': 'ar_TN.ISO8859-6',
  609.     'ar_ye': 'ar_YE.ISO8859-6',
  610.     'ar_ye.iso88596': 'ar_YE.ISO8859-6',
  611.     'arabic': 'ar_AA.ISO8859-6',
  612.     'arabic.iso88596': 'ar_AA.ISO8859-6',
  613.     'as': 'as_IN.UTF-8',
  614.     'az': 'az_AZ.ISO8859-9E',
  615.     'az_az': 'az_AZ.ISO8859-9E',
  616.     'az_az.iso88599e': 'az_AZ.ISO8859-9E',
  617.     'be': 'be_BY.CP1251',
  618.     'be@latin': 'be_BY.UTF-8@latin',
  619.     'be_by': 'be_BY.CP1251',
  620.     'be_by.cp1251': 'be_BY.CP1251',
  621.     'be_by.microsoftcp1251': 'be_BY.CP1251',
  622.     'be_by.utf8@latin': 'be_BY.UTF-8@latin',
  623.     'be_by@latin': 'be_BY.UTF-8@latin',
  624.     'bg': 'bg_BG.CP1251',
  625.     'bg_bg': 'bg_BG.CP1251',
  626.     'bg_bg.cp1251': 'bg_BG.CP1251',
  627.     'bg_bg.iso88595': 'bg_BG.ISO8859-5',
  628.     'bg_bg.koi8r': 'bg_BG.KOI8-R',
  629.     'bg_bg.microsoftcp1251': 'bg_BG.CP1251',
  630.     'bn_in': 'bn_IN.UTF-8',
  631.     'bokmal': 'nb_NO.ISO8859-1',
  632.     'bokm\xe5l': 'nb_NO.ISO8859-1',
  633.     'br': 'br_FR.ISO8859-1',
  634.     'br_fr': 'br_FR.ISO8859-1',
  635.     'br_fr.iso88591': 'br_FR.ISO8859-1',
  636.     'br_fr.iso885914': 'br_FR.ISO8859-14',
  637.     'br_fr.iso885915': 'br_FR.ISO8859-15',
  638.     'br_fr.iso885915@euro': 'br_FR.ISO8859-15',
  639.     'br_fr.utf8@euro': 'br_FR.UTF-8',
  640.     'br_fr@euro': 'br_FR.ISO8859-15',
  641.     'bs': 'bs_BA.ISO8859-2',
  642.     'bs_ba': 'bs_BA.ISO8859-2',
  643.     'bs_ba.iso88592': 'bs_BA.ISO8859-2',
  644.     'bulgarian': 'bg_BG.CP1251',
  645.     'c': 'C',
  646.     'c-french': 'fr_CA.ISO8859-1',
  647.     'c-french.iso88591': 'fr_CA.ISO8859-1',
  648.     'c.en': 'C',
  649.     'c.iso88591': 'en_US.ISO8859-1',
  650.     'c_c': 'C',
  651.     'c_c.c': 'C',
  652.     'ca': 'ca_ES.ISO8859-1',
  653.     'ca_ad': 'ca_AD.ISO8859-1',
  654.     'ca_ad.iso88591': 'ca_AD.ISO8859-1',
  655.     'ca_ad.iso885915': 'ca_AD.ISO8859-15',
  656.     'ca_ad.iso885915@euro': 'ca_AD.ISO8859-15',
  657.     'ca_ad.utf8@euro': 'ca_AD.UTF-8',
  658.     'ca_ad@euro': 'ca_AD.ISO8859-15',
  659.     'ca_es': 'ca_ES.ISO8859-1',
  660.     'ca_es.iso88591': 'ca_ES.ISO8859-1',
  661.     'ca_es.iso885915': 'ca_ES.ISO8859-15',
  662.     'ca_es.iso885915@euro': 'ca_ES.ISO8859-15',
  663.     'ca_es.utf8@euro': 'ca_ES.UTF-8',
  664.     'ca_es@euro': 'ca_ES.ISO8859-15',
  665.     'ca_fr': 'ca_FR.ISO8859-1',
  666.     'ca_fr.iso88591': 'ca_FR.ISO8859-1',
  667.     'ca_fr.iso885915': 'ca_FR.ISO8859-15',
  668.     'ca_fr.iso885915@euro': 'ca_FR.ISO8859-15',
  669.     'ca_fr.utf8@euro': 'ca_FR.UTF-8',
  670.     'ca_fr@euro': 'ca_FR.ISO8859-15',
  671.     'ca_it': 'ca_IT.ISO8859-1',
  672.     'ca_it.iso88591': 'ca_IT.ISO8859-1',
  673.     'ca_it.iso885915': 'ca_IT.ISO8859-15',
  674.     'ca_it.iso885915@euro': 'ca_IT.ISO8859-15',
  675.     'ca_it.utf8@euro': 'ca_IT.UTF-8',
  676.     'ca_it@euro': 'ca_IT.ISO8859-15',
  677.     'catalan': 'ca_ES.ISO8859-1',
  678.     'cextend': 'en_US.ISO8859-1',
  679.     'cextend.en': 'en_US.ISO8859-1',
  680.     'chinese-s': 'zh_CN.eucCN',
  681.     'chinese-t': 'zh_TW.eucTW',
  682.     'croatian': 'hr_HR.ISO8859-2',
  683.     'cs': 'cs_CZ.ISO8859-2',
  684.     'cs_cs': 'cs_CZ.ISO8859-2',
  685.     'cs_cs.iso88592': 'cs_CS.ISO8859-2',
  686.     'cs_cz': 'cs_CZ.ISO8859-2',
  687.     'cs_cz.iso88592': 'cs_CZ.ISO8859-2',
  688.     'cy': 'cy_GB.ISO8859-1',
  689.     'cy_gb': 'cy_GB.ISO8859-1',
  690.     'cy_gb.iso88591': 'cy_GB.ISO8859-1',
  691.     'cy_gb.iso885914': 'cy_GB.ISO8859-14',
  692.     'cy_gb.iso885915': 'cy_GB.ISO8859-15',
  693.     'cy_gb@euro': 'cy_GB.ISO8859-15',
  694.     'cz': 'cs_CZ.ISO8859-2',
  695.     'cz_cz': 'cs_CZ.ISO8859-2',
  696.     'czech': 'cs_CZ.ISO8859-2',
  697.     'da': 'da_DK.ISO8859-1',
  698.     'da.iso885915': 'da_DK.ISO8859-15',
  699.     'da_dk': 'da_DK.ISO8859-1',
  700.     'da_dk.88591': 'da_DK.ISO8859-1',
  701.     'da_dk.885915': 'da_DK.ISO8859-15',
  702.     'da_dk.iso88591': 'da_DK.ISO8859-1',
  703.     'da_dk.iso885915': 'da_DK.ISO8859-15',
  704.     'da_dk@euro': 'da_DK.ISO8859-15',
  705.     'danish': 'da_DK.ISO8859-1',
  706.     'danish.iso88591': 'da_DK.ISO8859-1',
  707.     'dansk': 'da_DK.ISO8859-1',
  708.     'de': 'de_DE.ISO8859-1',
  709.     'de.iso885915': 'de_DE.ISO8859-15',
  710.     'de_at': 'de_AT.ISO8859-1',
  711.     'de_at.iso88591': 'de_AT.ISO8859-1',
  712.     'de_at.iso885915': 'de_AT.ISO8859-15',
  713.     'de_at.iso885915@euro': 'de_AT.ISO8859-15',
  714.     'de_at.utf8@euro': 'de_AT.UTF-8',
  715.     'de_at@euro': 'de_AT.ISO8859-15',
  716.     'de_be': 'de_BE.ISO8859-1',
  717.     'de_be.iso88591': 'de_BE.ISO8859-1',
  718.     'de_be.iso885915': 'de_BE.ISO8859-15',
  719.     'de_be.iso885915@euro': 'de_BE.ISO8859-15',
  720.     'de_be.utf8@euro': 'de_BE.UTF-8',
  721.     'de_be@euro': 'de_BE.ISO8859-15',
  722.     'de_ch': 'de_CH.ISO8859-1',
  723.     'de_ch.iso88591': 'de_CH.ISO8859-1',
  724.     'de_ch.iso885915': 'de_CH.ISO8859-15',
  725.     'de_ch@euro': 'de_CH.ISO8859-15',
  726.     'de_de': 'de_DE.ISO8859-1',
  727.     'de_de.88591': 'de_DE.ISO8859-1',
  728.     'de_de.885915': 'de_DE.ISO8859-15',
  729.     'de_de.885915@euro': 'de_DE.ISO8859-15',
  730.     'de_de.iso88591': 'de_DE.ISO8859-1',
  731.     'de_de.iso885915': 'de_DE.ISO8859-15',
  732.     'de_de.iso885915@euro': 'de_DE.ISO8859-15',
  733.     'de_de.utf8@euro': 'de_DE.UTF-8',
  734.     'de_de@euro': 'de_DE.ISO8859-15',
  735.     'de_lu': 'de_LU.ISO8859-1',
  736.     'de_lu.iso88591': 'de_LU.ISO8859-1',
  737.     'de_lu.iso885915': 'de_LU.ISO8859-15',
  738.     'de_lu.iso885915@euro': 'de_LU.ISO8859-15',
  739.     'de_lu.utf8@euro': 'de_LU.UTF-8',
  740.     'de_lu@euro': 'de_LU.ISO8859-15',
  741.     'deutsch': 'de_DE.ISO8859-1',
  742.     'dutch': 'nl_NL.ISO8859-1',
  743.     'dutch.iso88591': 'nl_BE.ISO8859-1',
  744.     'ee': 'ee_EE.ISO8859-4',
  745.     'ee_ee': 'ee_EE.ISO8859-4',
  746.     'ee_ee.iso88594': 'ee_EE.ISO8859-4',
  747.     'eesti': 'et_EE.ISO8859-1',
  748.     'el': 'el_GR.ISO8859-7',
  749.     'el_gr': 'el_GR.ISO8859-7',
  750.     'el_gr.iso88597': 'el_GR.ISO8859-7',
  751.     'el_gr@euro': 'el_GR.ISO8859-15',
  752.     'en': 'en_US.ISO8859-1',
  753.     'en.iso88591': 'en_US.ISO8859-1',
  754.     'en_au': 'en_AU.ISO8859-1',
  755.     'en_au.iso88591': 'en_AU.ISO8859-1',
  756.     'en_be': 'en_BE.ISO8859-1',
  757.     'en_be@euro': 'en_BE.ISO8859-15',
  758.     'en_bw': 'en_BW.ISO8859-1',
  759.     'en_bw.iso88591': 'en_BW.ISO8859-1',
  760.     'en_ca': 'en_CA.ISO8859-1',
  761.     'en_ca.iso88591': 'en_CA.ISO8859-1',
  762.     'en_gb': 'en_GB.ISO8859-1',
  763.     'en_gb.88591': 'en_GB.ISO8859-1',
  764.     'en_gb.iso88591': 'en_GB.ISO8859-1',
  765.     'en_gb.iso885915': 'en_GB.ISO8859-15',
  766.     'en_gb@euro': 'en_GB.ISO8859-15',
  767.     'en_hk': 'en_HK.ISO8859-1',
  768.     'en_hk.iso88591': 'en_HK.ISO8859-1',
  769.     'en_ie': 'en_IE.ISO8859-1',
  770.     'en_ie.iso88591': 'en_IE.ISO8859-1',
  771.     'en_ie.iso885915': 'en_IE.ISO8859-15',
  772.     'en_ie.iso885915@euro': 'en_IE.ISO8859-15',
  773.     'en_ie.utf8@euro': 'en_IE.UTF-8',
  774.     'en_ie@euro': 'en_IE.ISO8859-15',
  775.     'en_in': 'en_IN.ISO8859-1',
  776.     'en_nz': 'en_NZ.ISO8859-1',
  777.     'en_nz.iso88591': 'en_NZ.ISO8859-1',
  778.     'en_ph': 'en_PH.ISO8859-1',
  779.     'en_ph.iso88591': 'en_PH.ISO8859-1',
  780.     'en_sg': 'en_SG.ISO8859-1',
  781.     'en_sg.iso88591': 'en_SG.ISO8859-1',
  782.     'en_uk': 'en_GB.ISO8859-1',
  783.     'en_us': 'en_US.ISO8859-1',
  784.     'en_us.88591': 'en_US.ISO8859-1',
  785.     'en_us.885915': 'en_US.ISO8859-15',
  786.     'en_us.iso88591': 'en_US.ISO8859-1',
  787.     'en_us.iso885915': 'en_US.ISO8859-15',
  788.     'en_us.iso885915@euro': 'en_US.ISO8859-15',
  789.     'en_us@euro': 'en_US.ISO8859-15',
  790.     'en_us@euro@euro': 'en_US.ISO8859-15',
  791.     'en_za': 'en_ZA.ISO8859-1',
  792.     'en_za.88591': 'en_ZA.ISO8859-1',
  793.     'en_za.iso88591': 'en_ZA.ISO8859-1',
  794.     'en_za.iso885915': 'en_ZA.ISO8859-15',
  795.     'en_za@euro': 'en_ZA.ISO8859-15',
  796.     'en_zw': 'en_ZW.ISO8859-1',
  797.     'en_zw.iso88591': 'en_ZW.ISO8859-1',
  798.     'eng_gb': 'en_GB.ISO8859-1',
  799.     'eng_gb.8859': 'en_GB.ISO8859-1',
  800.     'english': 'en_EN.ISO8859-1',
  801.     'english.iso88591': 'en_EN.ISO8859-1',
  802.     'english_uk': 'en_GB.ISO8859-1',
  803.     'english_uk.8859': 'en_GB.ISO8859-1',
  804.     'english_united-states': 'en_US.ISO8859-1',
  805.     'english_united-states.437': 'C',
  806.     'english_us': 'en_US.ISO8859-1',
  807.     'english_us.8859': 'en_US.ISO8859-1',
  808.     'english_us.ascii': 'en_US.ISO8859-1',
  809.     'eo': 'eo_XX.ISO8859-3',
  810.     'eo_eo': 'eo_EO.ISO8859-3',
  811.     'eo_eo.iso88593': 'eo_EO.ISO8859-3',
  812.     'eo_xx': 'eo_XX.ISO8859-3',
  813.     'eo_xx.iso88593': 'eo_XX.ISO8859-3',
  814.     'es': 'es_ES.ISO8859-1',
  815.     'es_ar': 'es_AR.ISO8859-1',
  816.     'es_ar.iso88591': 'es_AR.ISO8859-1',
  817.     'es_bo': 'es_BO.ISO8859-1',
  818.     'es_bo.iso88591': 'es_BO.ISO8859-1',
  819.     'es_cl': 'es_CL.ISO8859-1',
  820.     'es_cl.iso88591': 'es_CL.ISO8859-1',
  821.     'es_co': 'es_CO.ISO8859-1',
  822.     'es_co.iso88591': 'es_CO.ISO8859-1',
  823.     'es_cr': 'es_CR.ISO8859-1',
  824.     'es_cr.iso88591': 'es_CR.ISO8859-1',
  825.     'es_do': 'es_DO.ISO8859-1',
  826.     'es_do.iso88591': 'es_DO.ISO8859-1',
  827.     'es_ec': 'es_EC.ISO8859-1',
  828.     'es_ec.iso88591': 'es_EC.ISO8859-1',
  829.     'es_es': 'es_ES.ISO8859-1',
  830.     'es_es.88591': 'es_ES.ISO8859-1',
  831.     'es_es.iso88591': 'es_ES.ISO8859-1',
  832.     'es_es.iso885915': 'es_ES.ISO8859-15',
  833.     'es_es.iso885915@euro': 'es_ES.ISO8859-15',
  834.     'es_es.utf8@euro': 'es_ES.UTF-8',
  835.     'es_es@euro': 'es_ES.ISO8859-15',
  836.     'es_gt': 'es_GT.ISO8859-1',
  837.     'es_gt.iso88591': 'es_GT.ISO8859-1',
  838.     'es_hn': 'es_HN.ISO8859-1',
  839.     'es_hn.iso88591': 'es_HN.ISO8859-1',
  840.     'es_mx': 'es_MX.ISO8859-1',
  841.     'es_mx.iso88591': 'es_MX.ISO8859-1',
  842.     'es_ni': 'es_NI.ISO8859-1',
  843.     'es_ni.iso88591': 'es_NI.ISO8859-1',
  844.     'es_pa': 'es_PA.ISO8859-1',
  845.     'es_pa.iso88591': 'es_PA.ISO8859-1',
  846.     'es_pa.iso885915': 'es_PA.ISO8859-15',
  847.     'es_pa@euro': 'es_PA.ISO8859-15',
  848.     'es_pe': 'es_PE.ISO8859-1',
  849.     'es_pe.iso88591': 'es_PE.ISO8859-1',
  850.     'es_pe.iso885915': 'es_PE.ISO8859-15',
  851.     'es_pe@euro': 'es_PE.ISO8859-15',
  852.     'es_pr': 'es_PR.ISO8859-1',
  853.     'es_pr.iso88591': 'es_PR.ISO8859-1',
  854.     'es_py': 'es_PY.ISO8859-1',
  855.     'es_py.iso88591': 'es_PY.ISO8859-1',
  856.     'es_py.iso885915': 'es_PY.ISO8859-15',
  857.     'es_py@euro': 'es_PY.ISO8859-15',
  858.     'es_sv': 'es_SV.ISO8859-1',
  859.     'es_sv.iso88591': 'es_SV.ISO8859-1',
  860.     'es_sv.iso885915': 'es_SV.ISO8859-15',
  861.     'es_sv@euro': 'es_SV.ISO8859-15',
  862.     'es_us': 'es_US.ISO8859-1',
  863.     'es_us.iso88591': 'es_US.ISO8859-1',
  864.     'es_uy': 'es_UY.ISO8859-1',
  865.     'es_uy.iso88591': 'es_UY.ISO8859-1',
  866.     'es_uy.iso885915': 'es_UY.ISO8859-15',
  867.     'es_uy@euro': 'es_UY.ISO8859-15',
  868.     'es_ve': 'es_VE.ISO8859-1',
  869.     'es_ve.iso88591': 'es_VE.ISO8859-1',
  870.     'es_ve.iso885915': 'es_VE.ISO8859-15',
  871.     'es_ve@euro': 'es_VE.ISO8859-15',
  872.     'estonian': 'et_EE.ISO8859-1',
  873.     'et': 'et_EE.ISO8859-15',
  874.     'et_ee': 'et_EE.ISO8859-15',
  875.     'et_ee.iso88591': 'et_EE.ISO8859-1',
  876.     'et_ee.iso885913': 'et_EE.ISO8859-13',
  877.     'et_ee.iso885915': 'et_EE.ISO8859-15',
  878.     'et_ee.iso88594': 'et_EE.ISO8859-4',
  879.     'et_ee@euro': 'et_EE.ISO8859-15',
  880.     'eu': 'eu_ES.ISO8859-1',
  881.     'eu_es': 'eu_ES.ISO8859-1',
  882.     'eu_es.iso88591': 'eu_ES.ISO8859-1',
  883.     'eu_es.iso885915': 'eu_ES.ISO8859-15',
  884.     'eu_es.iso885915@euro': 'eu_ES.ISO8859-15',
  885.     'eu_es.utf8@euro': 'eu_ES.UTF-8',
  886.     'eu_es@euro': 'eu_ES.ISO8859-15',
  887.     'fa': 'fa_IR.UTF-8',
  888.     'fa_ir': 'fa_IR.UTF-8',
  889.     'fa_ir.isiri3342': 'fa_IR.ISIRI-3342',
  890.     'fi': 'fi_FI.ISO8859-15',
  891.     'fi.iso885915': 'fi_FI.ISO8859-15',
  892.     'fi_fi': 'fi_FI.ISO8859-15',
  893.     'fi_fi.88591': 'fi_FI.ISO8859-1',
  894.     'fi_fi.iso88591': 'fi_FI.ISO8859-1',
  895.     'fi_fi.iso885915': 'fi_FI.ISO8859-15',
  896.     'fi_fi.iso885915@euro': 'fi_FI.ISO8859-15',
  897.     'fi_fi.utf8@euro': 'fi_FI.UTF-8',
  898.     'fi_fi@euro': 'fi_FI.ISO8859-15',
  899.     'finnish': 'fi_FI.ISO8859-1',
  900.     'finnish.iso88591': 'fi_FI.ISO8859-1',
  901.     'fo': 'fo_FO.ISO8859-1',
  902.     'fo_fo': 'fo_FO.ISO8859-1',
  903.     'fo_fo.iso88591': 'fo_FO.ISO8859-1',
  904.     'fo_fo.iso885915': 'fo_FO.ISO8859-15',
  905.     'fo_fo@euro': 'fo_FO.ISO8859-15',
  906.     'fr': 'fr_FR.ISO8859-1',
  907.     'fr.iso885915': 'fr_FR.ISO8859-15',
  908.     'fr_be': 'fr_BE.ISO8859-1',
  909.     'fr_be.88591': 'fr_BE.ISO8859-1',
  910.     'fr_be.iso88591': 'fr_BE.ISO8859-1',
  911.     'fr_be.iso885915': 'fr_BE.ISO8859-15',
  912.     'fr_be.iso885915@euro': 'fr_BE.ISO8859-15',
  913.     'fr_be.utf8@euro': 'fr_BE.UTF-8',
  914.     'fr_be@euro': 'fr_BE.ISO8859-15',
  915.     'fr_ca': 'fr_CA.ISO8859-1',
  916.     'fr_ca.88591': 'fr_CA.ISO8859-1',
  917.     'fr_ca.iso88591': 'fr_CA.ISO8859-1',
  918.     'fr_ca.iso885915': 'fr_CA.ISO8859-15',
  919.     'fr_ca@euro': 'fr_CA.ISO8859-15',
  920.     'fr_ch': 'fr_CH.ISO8859-1',
  921.     'fr_ch.88591': 'fr_CH.ISO8859-1',
  922.     'fr_ch.iso88591': 'fr_CH.ISO8859-1',
  923.     'fr_ch.iso885915': 'fr_CH.ISO8859-15',
  924.     'fr_ch@euro': 'fr_CH.ISO8859-15',
  925.     'fr_fr': 'fr_FR.ISO8859-1',
  926.     'fr_fr.88591': 'fr_FR.ISO8859-1',
  927.     'fr_fr.iso88591': 'fr_FR.ISO8859-1',
  928.     'fr_fr.iso885915': 'fr_FR.ISO8859-15',
  929.     'fr_fr.iso885915@euro': 'fr_FR.ISO8859-15',
  930.     'fr_fr.utf8@euro': 'fr_FR.UTF-8',
  931.     'fr_fr@euro': 'fr_FR.ISO8859-15',
  932.     'fr_lu': 'fr_LU.ISO8859-1',
  933.     'fr_lu.88591': 'fr_LU.ISO8859-1',
  934.     'fr_lu.iso88591': 'fr_LU.ISO8859-1',
  935.     'fr_lu.iso885915': 'fr_LU.ISO8859-15',
  936.     'fr_lu.iso885915@euro': 'fr_LU.ISO8859-15',
  937.     'fr_lu.utf8@euro': 'fr_LU.UTF-8',
  938.     'fr_lu@euro': 'fr_LU.ISO8859-15',
  939.     'fran\xe7ais': 'fr_FR.ISO8859-1',
  940.     'fre_fr': 'fr_FR.ISO8859-1',
  941.     'fre_fr.8859': 'fr_FR.ISO8859-1',
  942.     'french': 'fr_FR.ISO8859-1',
  943.     'french.iso88591': 'fr_CH.ISO8859-1',
  944.     'french_france': 'fr_FR.ISO8859-1',
  945.     'french_france.8859': 'fr_FR.ISO8859-1',
  946.     'ga': 'ga_IE.ISO8859-1',
  947.     'ga_ie': 'ga_IE.ISO8859-1',
  948.     'ga_ie.iso88591': 'ga_IE.ISO8859-1',
  949.     'ga_ie.iso885914': 'ga_IE.ISO8859-14',
  950.     'ga_ie.iso885915': 'ga_IE.ISO8859-15',
  951.     'ga_ie.iso885915@euro': 'ga_IE.ISO8859-15',
  952.     'ga_ie.utf8@euro': 'ga_IE.UTF-8',
  953.     'ga_ie@euro': 'ga_IE.ISO8859-15',
  954.     'galego': 'gl_ES.ISO8859-1',
  955.     'galician': 'gl_ES.ISO8859-1',
  956.     'gd': 'gd_GB.ISO8859-1',
  957.     'gd_gb': 'gd_GB.ISO8859-1',
  958.     'gd_gb.iso88591': 'gd_GB.ISO8859-1',
  959.     'gd_gb.iso885914': 'gd_GB.ISO8859-14',
  960.     'gd_gb.iso885915': 'gd_GB.ISO8859-15',
  961.     'gd_gb@euro': 'gd_GB.ISO8859-15',
  962.     'ger_de': 'de_DE.ISO8859-1',
  963.     'ger_de.8859': 'de_DE.ISO8859-1',
  964.     'german': 'de_DE.ISO8859-1',
  965.     'german.iso88591': 'de_CH.ISO8859-1',
  966.     'german_germany': 'de_DE.ISO8859-1',
  967.     'german_germany.8859': 'de_DE.ISO8859-1',
  968.     'gl': 'gl_ES.ISO8859-1',
  969.     'gl_es': 'gl_ES.ISO8859-1',
  970.     'gl_es.iso88591': 'gl_ES.ISO8859-1',
  971.     'gl_es.iso885915': 'gl_ES.ISO8859-15',
  972.     'gl_es.iso885915@euro': 'gl_ES.ISO8859-15',
  973.     'gl_es.utf8@euro': 'gl_ES.UTF-8',
  974.     'gl_es@euro': 'gl_ES.ISO8859-15',
  975.     'greek': 'el_GR.ISO8859-7',
  976.     'greek.iso88597': 'el_GR.ISO8859-7',
  977.     'gu_in': 'gu_IN.UTF-8',
  978.     'gv': 'gv_GB.ISO8859-1',
  979.     'gv_gb': 'gv_GB.ISO8859-1',
  980.     'gv_gb.iso88591': 'gv_GB.ISO8859-1',
  981.     'gv_gb.iso885914': 'gv_GB.ISO8859-14',
  982.     'gv_gb.iso885915': 'gv_GB.ISO8859-15',
  983.     'gv_gb@euro': 'gv_GB.ISO8859-15',
  984.     'he': 'he_IL.ISO8859-8',
  985.     'he_il': 'he_IL.ISO8859-8',
  986.     'he_il.cp1255': 'he_IL.CP1255',
  987.     'he_il.iso88598': 'he_IL.ISO8859-8',
  988.     'he_il.microsoftcp1255': 'he_IL.CP1255',
  989.     'hebrew': 'iw_IL.ISO8859-8',
  990.     'hebrew.iso88598': 'iw_IL.ISO8859-8',
  991.     'hi': 'hi_IN.ISCII-DEV',
  992.     'hi_in': 'hi_IN.ISCII-DEV',
  993.     'hi_in.isciidev': 'hi_IN.ISCII-DEV',
  994.     'hne': 'hne_IN.UTF-8',
  995.     'hr': 'hr_HR.ISO8859-2',
  996.     'hr_hr': 'hr_HR.ISO8859-2',
  997.     'hr_hr.iso88592': 'hr_HR.ISO8859-2',
  998.     'hrvatski': 'hr_HR.ISO8859-2',
  999.     'hu': 'hu_HU.ISO8859-2',
  1000.     'hu_hu': 'hu_HU.ISO8859-2',
  1001.     'hu_hu.iso88592': 'hu_HU.ISO8859-2',
  1002.     'hungarian': 'hu_HU.ISO8859-2',
  1003.     'icelandic': 'is_IS.ISO8859-1',
  1004.     'icelandic.iso88591': 'is_IS.ISO8859-1',
  1005.     'id': 'id_ID.ISO8859-1',
  1006.     'id_id': 'id_ID.ISO8859-1',
  1007.     'in': 'id_ID.ISO8859-1',
  1008.     'in_id': 'id_ID.ISO8859-1',
  1009.     'is': 'is_IS.ISO8859-1',
  1010.     'is_is': 'is_IS.ISO8859-1',
  1011.     'is_is.iso88591': 'is_IS.ISO8859-1',
  1012.     'is_is.iso885915': 'is_IS.ISO8859-15',
  1013.     'is_is@euro': 'is_IS.ISO8859-15',
  1014.     'iso-8859-1': 'en_US.ISO8859-1',
  1015.     'iso-8859-15': 'en_US.ISO8859-15',
  1016.     'iso8859-1': 'en_US.ISO8859-1',
  1017.     'iso8859-15': 'en_US.ISO8859-15',
  1018.     'iso_8859_1': 'en_US.ISO8859-1',
  1019.     'iso_8859_15': 'en_US.ISO8859-15',
  1020.     'it': 'it_IT.ISO8859-1',
  1021.     'it.iso885915': 'it_IT.ISO8859-15',
  1022.     'it_ch': 'it_CH.ISO8859-1',
  1023.     'it_ch.iso88591': 'it_CH.ISO8859-1',
  1024.     'it_ch.iso885915': 'it_CH.ISO8859-15',
  1025.     'it_ch@euro': 'it_CH.ISO8859-15',
  1026.     'it_it': 'it_IT.ISO8859-1',
  1027.     'it_it.88591': 'it_IT.ISO8859-1',
  1028.     'it_it.iso88591': 'it_IT.ISO8859-1',
  1029.     'it_it.iso885915': 'it_IT.ISO8859-15',
  1030.     'it_it.iso885915@euro': 'it_IT.ISO8859-15',
  1031.     'it_it.utf8@euro': 'it_IT.UTF-8',
  1032.     'it_it@euro': 'it_IT.ISO8859-15',
  1033.     'italian': 'it_IT.ISO8859-1',
  1034.     'italian.iso88591': 'it_IT.ISO8859-1',
  1035.     'iu': 'iu_CA.NUNACOM-8',
  1036.     'iu_ca': 'iu_CA.NUNACOM-8',
  1037.     'iu_ca.nunacom8': 'iu_CA.NUNACOM-8',
  1038.     'iw': 'he_IL.ISO8859-8',
  1039.     'iw_il': 'he_IL.ISO8859-8',
  1040.     'iw_il.iso88598': 'he_IL.ISO8859-8',
  1041.     'ja': 'ja_JP.eucJP',
  1042.     'ja.jis': 'ja_JP.JIS7',
  1043.     'ja.sjis': 'ja_JP.SJIS',
  1044.     'ja_jp': 'ja_JP.eucJP',
  1045.     'ja_jp.ajec': 'ja_JP.eucJP',
  1046.     'ja_jp.euc': 'ja_JP.eucJP',
  1047.     'ja_jp.eucjp': 'ja_JP.eucJP',
  1048.     'ja_jp.iso-2022-jp': 'ja_JP.JIS7',
  1049.     'ja_jp.iso2022jp': 'ja_JP.JIS7',
  1050.     'ja_jp.jis': 'ja_JP.JIS7',
  1051.     'ja_jp.jis7': 'ja_JP.JIS7',
  1052.     'ja_jp.mscode': 'ja_JP.SJIS',
  1053.     'ja_jp.pck': 'ja_JP.SJIS',
  1054.     'ja_jp.sjis': 'ja_JP.SJIS',
  1055.     'ja_jp.ujis': 'ja_JP.eucJP',
  1056.     'japan': 'ja_JP.eucJP',
  1057.     'japanese': 'ja_JP.eucJP',
  1058.     'japanese-euc': 'ja_JP.eucJP',
  1059.     'japanese.euc': 'ja_JP.eucJP',
  1060.     'japanese.sjis': 'ja_JP.SJIS',
  1061.     'jp_jp': 'ja_JP.eucJP',
  1062.     'ka': 'ka_GE.GEORGIAN-ACADEMY',
  1063.     'ka_ge': 'ka_GE.GEORGIAN-ACADEMY',
  1064.     'ka_ge.georgianacademy': 'ka_GE.GEORGIAN-ACADEMY',
  1065.     'ka_ge.georgianps': 'ka_GE.GEORGIAN-PS',
  1066.     'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY',
  1067.     'kl': 'kl_GL.ISO8859-1',
  1068.     'kl_gl': 'kl_GL.ISO8859-1',
  1069.     'kl_gl.iso88591': 'kl_GL.ISO8859-1',
  1070.     'kl_gl.iso885915': 'kl_GL.ISO8859-15',
  1071.     'kl_gl@euro': 'kl_GL.ISO8859-15',
  1072.     'km_kh': 'km_KH.UTF-8',
  1073.     'kn': 'kn_IN.UTF-8',
  1074.     'kn_in': 'kn_IN.UTF-8',
  1075.     'ko': 'ko_KR.eucKR',
  1076.     'ko_kr': 'ko_KR.eucKR',
  1077.     'ko_kr.euc': 'ko_KR.eucKR',
  1078.     'ko_kr.euckr': 'ko_KR.eucKR',
  1079.     'korean': 'ko_KR.eucKR',
  1080.     'korean.euc': 'ko_KR.eucKR',
  1081.     'ks': 'ks_IN.UTF-8',
  1082.     'ks_in@devanagari': 'ks_IN@devanagari.UTF-8',
  1083.     'kw': 'kw_GB.ISO8859-1',
  1084.     'kw_gb': 'kw_GB.ISO8859-1',
  1085.     'kw_gb.iso88591': 'kw_GB.ISO8859-1',
  1086.     'kw_gb.iso885914': 'kw_GB.ISO8859-14',
  1087.     'kw_gb.iso885915': 'kw_GB.ISO8859-15',
  1088.     'kw_gb@euro': 'kw_GB.ISO8859-15',
  1089.     'ky': 'ky_KG.UTF-8',
  1090.     'ky_kg': 'ky_KG.UTF-8',
  1091.     'lithuanian': 'lt_LT.ISO8859-13',
  1092.     'lo': 'lo_LA.MULELAO-1',
  1093.     'lo_la': 'lo_LA.MULELAO-1',
  1094.     'lo_la.cp1133': 'lo_LA.IBM-CP1133',
  1095.     'lo_la.ibmcp1133': 'lo_LA.IBM-CP1133',
  1096.     'lo_la.mulelao1': 'lo_LA.MULELAO-1',
  1097.     'lt': 'lt_LT.ISO8859-13',
  1098.     'lt_lt': 'lt_LT.ISO8859-13',
  1099.     'lt_lt.iso885913': 'lt_LT.ISO8859-13',
  1100.     'lt_lt.iso88594': 'lt_LT.ISO8859-4',
  1101.     'lv': 'lv_LV.ISO8859-13',
  1102.     'lv_lv': 'lv_LV.ISO8859-13',
  1103.     'lv_lv.iso885913': 'lv_LV.ISO8859-13',
  1104.     'lv_lv.iso88594': 'lv_LV.ISO8859-4',
  1105.     'mai': 'mai_IN.UTF-8',
  1106.     'mi': 'mi_NZ.ISO8859-1',
  1107.     'mi_nz': 'mi_NZ.ISO8859-1',
  1108.     'mi_nz.iso88591': 'mi_NZ.ISO8859-1',
  1109.     'mk': 'mk_MK.ISO8859-5',
  1110.     'mk_mk': 'mk_MK.ISO8859-5',
  1111.     'mk_mk.cp1251': 'mk_MK.CP1251',
  1112.     'mk_mk.iso88595': 'mk_MK.ISO8859-5',
  1113.     'mk_mk.microsoftcp1251': 'mk_MK.CP1251',
  1114.     'ml': 'ml_IN.UTF-8',
  1115.     'mr': 'mr_IN.UTF-8',
  1116.     'mr_in': 'mr_IN.UTF-8',
  1117.     'ms': 'ms_MY.ISO8859-1',
  1118.     'ms_my': 'ms_MY.ISO8859-1',
  1119.     'ms_my.iso88591': 'ms_MY.ISO8859-1',
  1120.     'mt': 'mt_MT.ISO8859-3',
  1121.     'mt_mt': 'mt_MT.ISO8859-3',
  1122.     'mt_mt.iso88593': 'mt_MT.ISO8859-3',
  1123.     'nb': 'nb_NO.ISO8859-1',
  1124.     'nb_no': 'nb_NO.ISO8859-1',
  1125.     'nb_no.88591': 'nb_NO.ISO8859-1',
  1126.     'nb_no.iso88591': 'nb_NO.ISO8859-1',
  1127.     'nb_no.iso885915': 'nb_NO.ISO8859-15',
  1128.     'nb_no@euro': 'nb_NO.ISO8859-15',
  1129.     'nl': 'nl_NL.ISO8859-1',
  1130.     'nl.iso885915': 'nl_NL.ISO8859-15',
  1131.     'nl_be': 'nl_BE.ISO8859-1',
  1132.     'nl_be.88591': 'nl_BE.ISO8859-1',
  1133.     'nl_be.iso88591': 'nl_BE.ISO8859-1',
  1134.     'nl_be.iso885915': 'nl_BE.ISO8859-15',
  1135.     'nl_be.iso885915@euro': 'nl_BE.ISO8859-15',
  1136.     'nl_be.utf8@euro': 'nl_BE.UTF-8',
  1137.     'nl_be@euro': 'nl_BE.ISO8859-15',
  1138.     'nl_nl': 'nl_NL.ISO8859-1',
  1139.     'nl_nl.88591': 'nl_NL.ISO8859-1',
  1140.     'nl_nl.iso88591': 'nl_NL.ISO8859-1',
  1141.     'nl_nl.iso885915': 'nl_NL.ISO8859-15',
  1142.     'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15',
  1143.     'nl_nl.utf8@euro': 'nl_NL.UTF-8',
  1144.     'nl_nl@euro': 'nl_NL.ISO8859-15',
  1145.     'nn': 'nn_NO.ISO8859-1',
  1146.     'nn_no': 'nn_NO.ISO8859-1',
  1147.     'nn_no.88591': 'nn_NO.ISO8859-1',
  1148.     'nn_no.iso88591': 'nn_NO.ISO8859-1',
  1149.     'nn_no.iso885915': 'nn_NO.ISO8859-15',
  1150.     'nn_no@euro': 'nn_NO.ISO8859-15',
  1151.     'no': 'no_NO.ISO8859-1',
  1152.     'no@nynorsk': 'ny_NO.ISO8859-1',
  1153.     'no_no': 'no_NO.ISO8859-1',
  1154.     'no_no.88591': 'no_NO.ISO8859-1',
  1155.     'no_no.iso88591': 'no_NO.ISO8859-1',
  1156.     'no_no.iso885915': 'no_NO.ISO8859-15',
  1157.     'no_no.iso88591@bokmal': 'no_NO.ISO8859-1',
  1158.     'no_no.iso88591@nynorsk': 'no_NO.ISO8859-1',
  1159.     'no_no@euro': 'no_NO.ISO8859-15',
  1160.     'norwegian': 'no_NO.ISO8859-1',
  1161.     'norwegian.iso88591': 'no_NO.ISO8859-1',
  1162.     'nr': 'nr_ZA.ISO8859-1',
  1163.     'nr_za': 'nr_ZA.ISO8859-1',
  1164.     'nr_za.iso88591': 'nr_ZA.ISO8859-1',
  1165.     'nso': 'nso_ZA.ISO8859-15',
  1166.     'nso_za': 'nso_ZA.ISO8859-15',
  1167.     'nso_za.iso885915': 'nso_ZA.ISO8859-15',
  1168.     'ny': 'ny_NO.ISO8859-1',
  1169.     'ny_no': 'ny_NO.ISO8859-1',
  1170.     'ny_no.88591': 'ny_NO.ISO8859-1',
  1171.     'ny_no.iso88591': 'ny_NO.ISO8859-1',
  1172.     'ny_no.iso885915': 'ny_NO.ISO8859-15',
  1173.     'ny_no@euro': 'ny_NO.ISO8859-15',
  1174.     'nynorsk': 'nn_NO.ISO8859-1',
  1175.     'oc': 'oc_FR.ISO8859-1',
  1176.     'oc_fr': 'oc_FR.ISO8859-1',
  1177.     'oc_fr.iso88591': 'oc_FR.ISO8859-1',
  1178.     'oc_fr.iso885915': 'oc_FR.ISO8859-15',
  1179.     'oc_fr@euro': 'oc_FR.ISO8859-15',
  1180.     'or': 'or_IN.UTF-8',
  1181.     'pa': 'pa_IN.UTF-8',
  1182.     'pa_in': 'pa_IN.UTF-8',
  1183.     'pd': 'pd_US.ISO8859-1',
  1184.     'pd_de': 'pd_DE.ISO8859-1',
  1185.     'pd_de.iso88591': 'pd_DE.ISO8859-1',
  1186.     'pd_de.iso885915': 'pd_DE.ISO8859-15',
  1187.     'pd_de@euro': 'pd_DE.ISO8859-15',
  1188.     'pd_us': 'pd_US.ISO8859-1',
  1189.     'pd_us.iso88591': 'pd_US.ISO8859-1',
  1190.     'pd_us.iso885915': 'pd_US.ISO8859-15',
  1191.     'pd_us@euro': 'pd_US.ISO8859-15',
  1192.     'ph': 'ph_PH.ISO8859-1',
  1193.     'ph_ph': 'ph_PH.ISO8859-1',
  1194.     'ph_ph.iso88591': 'ph_PH.ISO8859-1',
  1195.     'pl': 'pl_PL.ISO8859-2',
  1196.     'pl_pl': 'pl_PL.ISO8859-2',
  1197.     'pl_pl.iso88592': 'pl_PL.ISO8859-2',
  1198.     'polish': 'pl_PL.ISO8859-2',
  1199.     'portuguese': 'pt_PT.ISO8859-1',
  1200.     'portuguese.iso88591': 'pt_PT.ISO8859-1',
  1201.     'portuguese_brazil': 'pt_BR.ISO8859-1',
  1202.     'portuguese_brazil.8859': 'pt_BR.ISO8859-1',
  1203.     'posix': 'C',
  1204.     'posix-utf2': 'C',
  1205.     'pp': 'pp_AN.ISO8859-1',
  1206.     'pp_an': 'pp_AN.ISO8859-1',
  1207.     'pp_an.iso88591': 'pp_AN.ISO8859-1',
  1208.     'pt': 'pt_PT.ISO8859-1',
  1209.     'pt.iso885915': 'pt_PT.ISO8859-15',
  1210.     'pt_br': 'pt_BR.ISO8859-1',
  1211.     'pt_br.88591': 'pt_BR.ISO8859-1',
  1212.     'pt_br.iso88591': 'pt_BR.ISO8859-1',
  1213.     'pt_br.iso885915': 'pt_BR.ISO8859-15',
  1214.     'pt_br@euro': 'pt_BR.ISO8859-15',
  1215.     'pt_pt': 'pt_PT.ISO8859-1',
  1216.     'pt_pt.88591': 'pt_PT.ISO8859-1',
  1217.     'pt_pt.iso88591': 'pt_PT.ISO8859-1',
  1218.     'pt_pt.iso885915': 'pt_PT.ISO8859-15',
  1219.     'pt_pt.iso885915@euro': 'pt_PT.ISO8859-15',
  1220.     'pt_pt.utf8@euro': 'pt_PT.UTF-8',
  1221.     'pt_pt@euro': 'pt_PT.ISO8859-15',
  1222.     'ro': 'ro_RO.ISO8859-2',
  1223.     'ro_ro': 'ro_RO.ISO8859-2',
  1224.     'ro_ro.iso88592': 'ro_RO.ISO8859-2',
  1225.     'romanian': 'ro_RO.ISO8859-2',
  1226.     'ru': 'ru_RU.UTF-8',
  1227.     'ru.koi8r': 'ru_RU.KOI8-R',
  1228.     'ru_ru': 'ru_RU.UTF-8',
  1229.     'ru_ru.cp1251': 'ru_RU.CP1251',
  1230.     'ru_ru.iso88595': 'ru_RU.ISO8859-5',
  1231.     'ru_ru.koi8r': 'ru_RU.KOI8-R',
  1232.     'ru_ru.microsoftcp1251': 'ru_RU.CP1251',
  1233.     'ru_ua': 'ru_UA.KOI8-U',
  1234.     'ru_ua.cp1251': 'ru_UA.CP1251',
  1235.     'ru_ua.koi8u': 'ru_UA.KOI8-U',
  1236.     'ru_ua.microsoftcp1251': 'ru_UA.CP1251',
  1237.     'rumanian': 'ro_RO.ISO8859-2',
  1238.     'russian': 'ru_RU.ISO8859-5',
  1239.     'rw': 'rw_RW.ISO8859-1',
  1240.     'rw_rw': 'rw_RW.ISO8859-1',
  1241.     'rw_rw.iso88591': 'rw_RW.ISO8859-1',
  1242.     'sd': 'sd_IN@devanagari.UTF-8',
  1243.     'se_no': 'se_NO.UTF-8',
  1244.     'serbocroatian': 'sr_RS.UTF-8@latin',
  1245.     'sh': 'sr_RS.UTF-8@latin',
  1246.     'sh_ba.iso88592@bosnia': 'sr_CS.ISO8859-2',
  1247.     'sh_hr': 'sh_HR.ISO8859-2',
  1248.     'sh_hr.iso88592': 'hr_HR.ISO8859-2',
  1249.     'sh_sp': 'sr_CS.ISO8859-2',
  1250.     'sh_yu': 'sr_RS.UTF-8@latin',
  1251.     'si': 'si_LK.UTF-8',
  1252.     'si_lk': 'si_LK.UTF-8',
  1253.     'sinhala': 'si_LK.UTF-8',
  1254.     'sk': 'sk_SK.ISO8859-2',
  1255.     'sk_sk': 'sk_SK.ISO8859-2',
  1256.     'sk_sk.iso88592': 'sk_SK.ISO8859-2',
  1257.     'sl': 'sl_SI.ISO8859-2',
  1258.     'sl_cs': 'sl_CS.ISO8859-2',
  1259.     'sl_si': 'sl_SI.ISO8859-2',
  1260.     'sl_si.iso88592': 'sl_SI.ISO8859-2',
  1261.     'slovak': 'sk_SK.ISO8859-2',
  1262.     'slovene': 'sl_SI.ISO8859-2',
  1263.     'slovenian': 'sl_SI.ISO8859-2',
  1264.     'sp': 'sr_CS.ISO8859-5',
  1265.     'sp_yu': 'sr_CS.ISO8859-5',
  1266.     'spanish': 'es_ES.ISO8859-1',
  1267.     'spanish.iso88591': 'es_ES.ISO8859-1',
  1268.     'spanish_spain': 'es_ES.ISO8859-1',
  1269.     'spanish_spain.8859': 'es_ES.ISO8859-1',
  1270.     'sq': 'sq_AL.ISO8859-2',
  1271.     'sq_al': 'sq_AL.ISO8859-2',
  1272.     'sq_al.iso88592': 'sq_AL.ISO8859-2',
  1273.     'sr': 'sr_RS.UTF-8',
  1274.     'sr@cyrillic': 'sr_RS.UTF-8',
  1275.     'sr@latin': 'sr_RS.UTF-8@latin',
  1276.     'sr@latn': 'sr_RS.UTF-8@latin',
  1277.     'sr_cs': 'sr_RS.UTF-8',
  1278.     'sr_cs.iso88592': 'sr_CS.ISO8859-2',
  1279.     'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2',
  1280.     'sr_cs.iso88595': 'sr_CS.ISO8859-5',
  1281.     'sr_cs.utf8@latn': 'sr_RS.UTF-8@latin',
  1282.     'sr_cs@latn': 'sr_RS.UTF-8@latin',
  1283.     'sr_me': 'sr_ME.UTF-8',
  1284.     'sr_rs': 'sr_RS.UTF-8',
  1285.     'sr_rs.utf8@latn': 'sr_RS.UTF-8@latin',
  1286.     'sr_rs@latin': 'sr_RS.UTF-8@latin',
  1287.     'sr_rs@latn': 'sr_RS.UTF-8@latin',
  1288.     'sr_sp': 'sr_CS.ISO8859-2',
  1289.     'sr_yu': 'sr_RS.UTF-8@latin',
  1290.     'sr_yu.cp1251@cyrillic': 'sr_CS.CP1251',
  1291.     'sr_yu.iso88592': 'sr_CS.ISO8859-2',
  1292.     'sr_yu.iso88595': 'sr_CS.ISO8859-5',
  1293.     'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5',
  1294.     'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251',
  1295.     'sr_yu.utf8@cyrillic': 'sr_RS.UTF-8',
  1296.     'sr_yu@cyrillic': 'sr_RS.UTF-8',
  1297.     'ss': 'ss_ZA.ISO8859-1',
  1298.     'ss_za': 'ss_ZA.ISO8859-1',
  1299.     'ss_za.iso88591': 'ss_ZA.ISO8859-1',
  1300.     'st': 'st_ZA.ISO8859-1',
  1301.     'st_za': 'st_ZA.ISO8859-1',
  1302.     'st_za.iso88591': 'st_ZA.ISO8859-1',
  1303.     'sv': 'sv_SE.ISO8859-1',
  1304.     'sv.iso885915': 'sv_SE.ISO8859-15',
  1305.     'sv_fi': 'sv_FI.ISO8859-1',
  1306.     'sv_fi.iso88591': 'sv_FI.ISO8859-1',
  1307.     'sv_fi.iso885915': 'sv_FI.ISO8859-15',
  1308.     'sv_fi.iso885915@euro': 'sv_FI.ISO8859-15',
  1309.     'sv_fi.utf8@euro': 'sv_FI.UTF-8',
  1310.     'sv_fi@euro': 'sv_FI.ISO8859-15',
  1311.     'sv_se': 'sv_SE.ISO8859-1',
  1312.     'sv_se.88591': 'sv_SE.ISO8859-1',
  1313.     'sv_se.iso88591': 'sv_SE.ISO8859-1',
  1314.     'sv_se.iso885915': 'sv_SE.ISO8859-15',
  1315.     'sv_se@euro': 'sv_SE.ISO8859-15',
  1316.     'swedish': 'sv_SE.ISO8859-1',
  1317.     'swedish.iso88591': 'sv_SE.ISO8859-1',
  1318.     'ta': 'ta_IN.TSCII-0',
  1319.     'ta_in': 'ta_IN.TSCII-0',
  1320.     'ta_in.tscii': 'ta_IN.TSCII-0',
  1321.     'ta_in.tscii0': 'ta_IN.TSCII-0',
  1322.     'te': 'te_IN.UTF-8',
  1323.     'tg': 'tg_TJ.KOI8-C',
  1324.     'tg_tj': 'tg_TJ.KOI8-C',
  1325.     'tg_tj.koi8c': 'tg_TJ.KOI8-C',
  1326.     'th': 'th_TH.ISO8859-11',
  1327.     'th_th': 'th_TH.ISO8859-11',
  1328.     'th_th.iso885911': 'th_TH.ISO8859-11',
  1329.     'th_th.tactis': 'th_TH.TIS620',
  1330.     'th_th.tis620': 'th_TH.TIS620',
  1331.     'thai': 'th_TH.ISO8859-11',
  1332.     'tl': 'tl_PH.ISO8859-1',
  1333.     'tl_ph': 'tl_PH.ISO8859-1',
  1334.     'tl_ph.iso88591': 'tl_PH.ISO8859-1',
  1335.     'tn': 'tn_ZA.ISO8859-15',
  1336.     'tn_za': 'tn_ZA.ISO8859-15',
  1337.     'tn_za.iso885915': 'tn_ZA.ISO8859-15',
  1338.     'tr': 'tr_TR.ISO8859-9',
  1339.     'tr_tr': 'tr_TR.ISO8859-9',
  1340.     'tr_tr.iso88599': 'tr_TR.ISO8859-9',
  1341.     'ts': 'ts_ZA.ISO8859-1',
  1342.     'ts_za': 'ts_ZA.ISO8859-1',
  1343.     'ts_za.iso88591': 'ts_ZA.ISO8859-1',
  1344.     'tt': 'tt_RU.TATAR-CYR',
  1345.     'tt_ru': 'tt_RU.TATAR-CYR',
  1346.     'tt_ru.koi8c': 'tt_RU.KOI8-C',
  1347.     'tt_ru.tatarcyr': 'tt_RU.TATAR-CYR',
  1348.     'turkish': 'tr_TR.ISO8859-9',
  1349.     'turkish.iso88599': 'tr_TR.ISO8859-9',
  1350.     'uk': 'uk_UA.KOI8-U',
  1351.     'uk_ua': 'uk_UA.KOI8-U',
  1352.     'uk_ua.cp1251': 'uk_UA.CP1251',
  1353.     'uk_ua.iso88595': 'uk_UA.ISO8859-5',
  1354.     'uk_ua.koi8u': 'uk_UA.KOI8-U',
  1355.     'uk_ua.microsoftcp1251': 'uk_UA.CP1251',
  1356.     'univ': 'en_US.utf',
  1357.     'universal': 'en_US.utf',
  1358.     'universal.utf8@ucs4': 'en_US.UTF-8',
  1359.     'ur': 'ur_PK.CP1256',
  1360.     'ur_pk': 'ur_PK.CP1256',
  1361.     'ur_pk.cp1256': 'ur_PK.CP1256',
  1362.     'ur_pk.microsoftcp1256': 'ur_PK.CP1256',
  1363.     'uz': 'uz_UZ.UTF-8',
  1364.     'uz_uz': 'uz_UZ.UTF-8',
  1365.     'uz_uz.iso88591': 'uz_UZ.ISO8859-1',
  1366.     'uz_uz.utf8@cyrillic': 'uz_UZ.UTF-8',
  1367.     'uz_uz@cyrillic': 'uz_UZ.UTF-8',
  1368.     've': 've_ZA.UTF-8',
  1369.     've_za': 've_ZA.UTF-8',
  1370.     'vi': 'vi_VN.TCVN',
  1371.     'vi_vn': 'vi_VN.TCVN',
  1372.     'vi_vn.tcvn': 'vi_VN.TCVN',
  1373.     'vi_vn.tcvn5712': 'vi_VN.TCVN',
  1374.     'vi_vn.viscii': 'vi_VN.VISCII',
  1375.     'vi_vn.viscii111': 'vi_VN.VISCII',
  1376.     'wa': 'wa_BE.ISO8859-1',
  1377.     'wa_be': 'wa_BE.ISO8859-1',
  1378.     'wa_be.iso88591': 'wa_BE.ISO8859-1',
  1379.     'wa_be.iso885915': 'wa_BE.ISO8859-15',
  1380.     'wa_be.iso885915@euro': 'wa_BE.ISO8859-15',
  1381.     'wa_be@euro': 'wa_BE.ISO8859-15',
  1382.     'xh': 'xh_ZA.ISO8859-1',
  1383.     'xh_za': 'xh_ZA.ISO8859-1',
  1384.     'xh_za.iso88591': 'xh_ZA.ISO8859-1',
  1385.     'yi': 'yi_US.CP1255',
  1386.     'yi_us': 'yi_US.CP1255',
  1387.     'yi_us.cp1255': 'yi_US.CP1255',
  1388.     'yi_us.microsoftcp1255': 'yi_US.CP1255',
  1389.     'zh': 'zh_CN.eucCN',
  1390.     'zh_cn': 'zh_CN.gb2312',
  1391.     'zh_cn.big5': 'zh_TW.big5',
  1392.     'zh_cn.euc': 'zh_CN.eucCN',
  1393.     'zh_cn.gb18030': 'zh_CN.gb18030',
  1394.     'zh_cn.gb2312': 'zh_CN.gb2312',
  1395.     'zh_cn.gbk': 'zh_CN.gbk',
  1396.     'zh_hk': 'zh_HK.big5hkscs',
  1397.     'zh_hk.big5': 'zh_HK.big5',
  1398.     'zh_hk.big5hk': 'zh_HK.big5hkscs',
  1399.     'zh_hk.big5hkscs': 'zh_HK.big5hkscs',
  1400.     'zh_tw': 'zh_TW.big5',
  1401.     'zh_tw.big5': 'zh_TW.big5',
  1402.     'zh_tw.euc': 'zh_TW.eucTW',
  1403.     'zh_tw.euctw': 'zh_TW.eucTW',
  1404.     'zu': 'zu_ZA.ISO8859-1',
  1405.     'zu_za': 'zu_ZA.ISO8859-1',
  1406.     'zu_za.iso88591': 'zu_ZA.ISO8859-1' }
  1407. windows_locale = {
  1408.     1078: 'af_ZA',
  1409.     1052: 'sq_AL',
  1410.     1156: 'gsw_FR',
  1411.     1118: 'am_ET',
  1412.     1025: 'ar_SA',
  1413.     2049: 'ar_IQ',
  1414.     3073: 'ar_EG',
  1415.     4097: 'ar_LY',
  1416.     5121: 'ar_DZ',
  1417.     6145: 'ar_MA',
  1418.     7169: 'ar_TN',
  1419.     8193: 'ar_OM',
  1420.     9217: 'ar_YE',
  1421.     10241: 'ar_SY',
  1422.     11265: 'ar_JO',
  1423.     12289: 'ar_LB',
  1424.     13313: 'ar_KW',
  1425.     14337: 'ar_AE',
  1426.     15361: 'ar_BH',
  1427.     16385: 'ar_QA',
  1428.     1067: 'hy_AM',
  1429.     1101: 'as_IN',
  1430.     1068: 'az_AZ',
  1431.     2092: 'az_AZ',
  1432.     1133: 'ba_RU',
  1433.     1069: 'eu_ES',
  1434.     1059: 'be_BY',
  1435.     1093: 'bn_IN',
  1436.     8218: 'bs_BA',
  1437.     5146: 'bs_BA',
  1438.     1150: 'br_FR',
  1439.     1026: 'bg_BG',
  1440.     1027: 'ca_ES',
  1441.     4: 'zh_CHS',
  1442.     1028: 'zh_TW',
  1443.     2052: 'zh_CN',
  1444.     3076: 'zh_HK',
  1445.     4100: 'zh_SG',
  1446.     5124: 'zh_MO',
  1447.     31748: 'zh_CHT',
  1448.     1155: 'co_FR',
  1449.     1050: 'hr_HR',
  1450.     4122: 'hr_BA',
  1451.     1029: 'cs_CZ',
  1452.     1030: 'da_DK',
  1453.     1164: 'gbz_AF',
  1454.     1125: 'div_MV',
  1455.     1043: 'nl_NL',
  1456.     2067: 'nl_BE',
  1457.     1033: 'en_US',
  1458.     2057: 'en_GB',
  1459.     3081: 'en_AU',
  1460.     4105: 'en_CA',
  1461.     5129: 'en_NZ',
  1462.     6153: 'en_IE',
  1463.     7177: 'en_ZA',
  1464.     8201: 'en_JA',
  1465.     9225: 'en_CB',
  1466.     10249: 'en_BZ',
  1467.     11273: 'en_TT',
  1468.     12297: 'en_ZW',
  1469.     13321: 'en_PH',
  1470.     16393: 'en_IN',
  1471.     17417: 'en_MY',
  1472.     18441: 'en_IN',
  1473.     1061: 'et_EE',
  1474.     1080: 'fo_FO',
  1475.     1124: 'fil_PH',
  1476.     1035: 'fi_FI',
  1477.     1036: 'fr_FR',
  1478.     2060: 'fr_BE',
  1479.     3084: 'fr_CA',
  1480.     4108: 'fr_CH',
  1481.     5132: 'fr_LU',
  1482.     6156: 'fr_MC',
  1483.     1122: 'fy_NL',
  1484.     1110: 'gl_ES',
  1485.     1079: 'ka_GE',
  1486.     1031: 'de_DE',
  1487.     2055: 'de_CH',
  1488.     3079: 'de_AT',
  1489.     4103: 'de_LU',
  1490.     5127: 'de_LI',
  1491.     1032: 'el_GR',
  1492.     1135: 'kl_GL',
  1493.     1095: 'gu_IN',
  1494.     1128: 'ha_NG',
  1495.     1037: 'he_IL',
  1496.     1081: 'hi_IN',
  1497.     1038: 'hu_HU',
  1498.     1039: 'is_IS',
  1499.     1057: 'id_ID',
  1500.     1117: 'iu_CA',
  1501.     2141: 'iu_CA',
  1502.     2108: 'ga_IE',
  1503.     1040: 'it_IT',
  1504.     2064: 'it_CH',
  1505.     1041: 'ja_JP',
  1506.     1099: 'kn_IN',
  1507.     1087: 'kk_KZ',
  1508.     1107: 'kh_KH',
  1509.     1158: 'qut_GT',
  1510.     1159: 'rw_RW',
  1511.     1111: 'kok_IN',
  1512.     1042: 'ko_KR',
  1513.     1088: 'ky_KG',
  1514.     1108: 'lo_LA',
  1515.     1062: 'lv_LV',
  1516.     1063: 'lt_LT',
  1517.     2094: 'dsb_DE',
  1518.     1134: 'lb_LU',
  1519.     1071: 'mk_MK',
  1520.     1086: 'ms_MY',
  1521.     2110: 'ms_BN',
  1522.     1100: 'ml_IN',
  1523.     1082: 'mt_MT',
  1524.     1153: 'mi_NZ',
  1525.     1146: 'arn_CL',
  1526.     1102: 'mr_IN',
  1527.     1148: 'moh_CA',
  1528.     1104: 'mn_MN',
  1529.     2128: 'mn_CN',
  1530.     1121: 'ne_NP',
  1531.     1044: 'nb_NO',
  1532.     2068: 'nn_NO',
  1533.     1154: 'oc_FR',
  1534.     1096: 'or_IN',
  1535.     1123: 'ps_AF',
  1536.     1065: 'fa_IR',
  1537.     1045: 'pl_PL',
  1538.     1046: 'pt_BR',
  1539.     2070: 'pt_PT',
  1540.     1094: 'pa_IN',
  1541.     1131: 'quz_BO',
  1542.     2155: 'quz_EC',
  1543.     3179: 'quz_PE',
  1544.     1048: 'ro_RO',
  1545.     1047: 'rm_CH',
  1546.     1049: 'ru_RU',
  1547.     9275: 'smn_FI',
  1548.     4155: 'smj_NO',
  1549.     5179: 'smj_SE',
  1550.     1083: 'se_NO',
  1551.     2107: 'se_SE',
  1552.     3131: 'se_FI',
  1553.     8251: 'sms_FI',
  1554.     6203: 'sma_NO',
  1555.     7227: 'sma_SE',
  1556.     1103: 'sa_IN',
  1557.     3098: 'sr_SP',
  1558.     7194: 'sr_BA',
  1559.     2074: 'sr_SP',
  1560.     6170: 'sr_BA',
  1561.     1115: 'si_LK',
  1562.     1132: 'ns_ZA',
  1563.     1074: 'tn_ZA',
  1564.     1051: 'sk_SK',
  1565.     1060: 'sl_SI',
  1566.     1034: 'es_ES',
  1567.     2058: 'es_MX',
  1568.     3082: 'es_ES',
  1569.     4106: 'es_GT',
  1570.     5130: 'es_CR',
  1571.     6154: 'es_PA',
  1572.     7178: 'es_DO',
  1573.     8202: 'es_VE',
  1574.     9226: 'es_CO',
  1575.     10250: 'es_PE',
  1576.     11274: 'es_AR',
  1577.     12298: 'es_EC',
  1578.     13322: 'es_CL',
  1579.     14346: 'es_UR',
  1580.     15370: 'es_PY',
  1581.     16394: 'es_BO',
  1582.     17418: 'es_SV',
  1583.     18442: 'es_HN',
  1584.     19466: 'es_NI',
  1585.     20490: 'es_PR',
  1586.     21514: 'es_US',
  1587.     1089: 'sw_KE',
  1588.     1053: 'sv_SE',
  1589.     2077: 'sv_FI',
  1590.     1114: 'syr_SY',
  1591.     1064: 'tg_TJ',
  1592.     2143: 'tmz_DZ',
  1593.     1097: 'ta_IN',
  1594.     1092: 'tt_RU',
  1595.     1098: 'te_IN',
  1596.     1054: 'th_TH',
  1597.     2129: 'bo_BT',
  1598.     1105: 'bo_CN',
  1599.     1055: 'tr_TR',
  1600.     1090: 'tk_TM',
  1601.     1152: 'ug_CN',
  1602.     1058: 'uk_UA',
  1603.     1070: 'wen_DE',
  1604.     1056: 'ur_PK',
  1605.     2080: 'ur_IN',
  1606.     1091: 'uz_UZ',
  1607.     2115: 'uz_UZ',
  1608.     1066: 'vi_VN',
  1609.     1106: 'cy_GB',
  1610.     1160: 'wo_SN',
  1611.     1076: 'xh_ZA',
  1612.     1157: 'sah_RU',
  1613.     1144: 'ii_CN',
  1614.     1130: 'yo_NG',
  1615.     1077: 'zu_ZA' }
  1616.  
  1617. def _print_locale():
  1618.     ''' Test function.
  1619.     '''
  1620.     categories = { }
  1621.     
  1622.     def _init_categories(categories = categories):
  1623.         for k, v in globals().items():
  1624.             if k[:3] == 'LC_':
  1625.                 categories[k] = v
  1626.                 continue
  1627.  
  1628.     _init_categories()
  1629.     del categories['LC_ALL']
  1630.     print 'Locale defaults as determined by getdefaultlocale():'
  1631.     print '-' * 72
  1632.     (lang, enc) = getdefaultlocale()
  1633.     print 'Language: ',
  1634.     if not lang:
  1635.         pass
  1636.     print '(undefined)'
  1637.     print 'Encoding: ',
  1638.     if not enc:
  1639.         pass
  1640.     print '(undefined)'
  1641.     print 
  1642.     print 'Locale settings on startup:'
  1643.     print '-' * 72
  1644.     for name, category in categories.items():
  1645.         print name, '...'
  1646.         (lang, enc) = getlocale(category)
  1647.         print '   Language: ',
  1648.         if not lang:
  1649.             pass
  1650.         print '(undefined)'
  1651.         print '   Encoding: ',
  1652.         if not enc:
  1653.             pass
  1654.         print '(undefined)'
  1655.         print 
  1656.     
  1657.     print 
  1658.     print 'Locale settings after calling resetlocale():'
  1659.     print '-' * 72
  1660.     resetlocale()
  1661.     for name, category in categories.items():
  1662.         print name, '...'
  1663.         (lang, enc) = getlocale(category)
  1664.         print '   Language: ',
  1665.         if not lang:
  1666.             pass
  1667.         print '(undefined)'
  1668.         print '   Encoding: ',
  1669.         if not enc:
  1670.             pass
  1671.         print '(undefined)'
  1672.         print 
  1673.     
  1674.     
  1675.     try:
  1676.         setlocale(LC_ALL, '')
  1677.     except:
  1678.         print 'NOTE:'
  1679.         print 'setlocale(LC_ALL, "") does not support the default locale'
  1680.         print 'given in the OS environment variables.'
  1681.  
  1682.     print 
  1683.     print 'Locale settings after calling setlocale(LC_ALL, ""):'
  1684.     print '-' * 72
  1685.     for name, category in categories.items():
  1686.         print name, '...'
  1687.         (lang, enc) = getlocale(category)
  1688.         print '   Language: ',
  1689.         if not lang:
  1690.             pass
  1691.         print '(undefined)'
  1692.         print '   Encoding: ',
  1693.         if not enc:
  1694.             pass
  1695.         print '(undefined)'
  1696.         print 
  1697.     
  1698.  
  1699.  
  1700. try:
  1701.     LC_MESSAGES
  1702. except NameError:
  1703.     pass
  1704.  
  1705. __all__.append('LC_MESSAGES')
  1706. if __name__ == '__main__':
  1707.     print 'Locale aliasing:'
  1708.     print 
  1709.     _print_locale()
  1710.     print 
  1711.     print 'Number formatting:'
  1712.     print 
  1713.     _test()
  1714.